package java基础.struct;

/**
 * @author IT_Jay
 * @date 2022/1/4 18:07
 */

public class Demo16 {
    public static void main(String[] args) {
        int[] numbers = {10,20,30,40};  //定义数组
        //遍历数组
        for (int i = 0; i < numbers.length; i++) {
            System.out.println(numbers[i]);     //numbers[i]就是取numbers数组中下标为i的内容
        }
        System.out.println("======================================================================");
        //遍历数组,与上一种方法比较理解
        for (int x:numbers){
            System.out.println(x);
        }
    }
}
